/*
** 3507.c
** 
** Made by (seakage2h)
** Login   <seakage2h@seakage2h-ubuntu>
** 
** Started on  Sat Sep 13 18:53:00 2008 seakage2h
** Last update Sun May 12 01:17:25 2002 Speed Blue
*/

/* #include "3507.h" */

#include <stdio.h>

int main()
{
     int j[6];			/* keep the scores */
     int min, max;		/* the lowest and highest mark */
     int result, quo, rem;
          
     while(1){
	  int i, total = 0;     /* i:iterator, total:total score */

	  for(i = 0; i < 6; i++)
	       scanf("%d", &j[i]);
	  for(i = 0; i < 6; i++)
	       total += j[i];
	  
	  if (total == 0)	/* all are zeros(because no negative values) */
	       return 0;

	  min = max = j[0];

	  for(i = 1; i < 6; i++){
	       if (j[i] < min) min = j[i];
	       if (j[i] > max) max = j[i];
	  }

	  result = total - max - min;
	  quo = result / 4;
	  rem = result % 4;
	  
	  /* WARNING: The only problem is the output
	   * use some tricks here */
	  switch(rem){
	  case 0:
	       printf("%d\n", quo);
	       break;
	  case 1:
	       printf("%.2f\n", (float)quo + 0.25);
	       break;
	  case 2:
	       printf("%.1f\n", (float)quo + 0.5);
	       break;
	  case 3:
	       printf("%.2f\n", (float)quo + 0.75);
	       break;
	  }
     }

     return 0;
}

